import { Component, signal } from '@angular/core';
import { DUMMY_USERS } from './dummy-users';
// 移除了 NgFor 导入，因为我们使用新的 @for 控制流语法
@Component({
  selector: 'app-root',
  templateUrl: './app.html',
  standalone:false,
  styleUrl: './app.scss',
})
export class App {
  protected readonly title = signal('my-ng-pro');
  users = DUMMY_USERS;
  selectedUserId?: string;

  get selectedUser() {
    return this.users.find((user) => user.id === this.selectedUserId)!;
  }

  onUserSelected(id: string) {
    this.selectedUserId = id;
  }
}
